package com.thinkgem.jeesite.modules.book.service;

import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.book.dao.BookTypeDao;
import com.thinkgem.jeesite.modules.book.entity.BkType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 流程模型相关Controller
 *
 * @author ThinkGem
 * @version 2013-11-03
 */
@Service
@Transactional(readOnly = true)
public class BookTypeService extends CrudService<BookTypeDao, BkType> {

    @Autowired
    private BookTypeDao bookTypeDao;


    @Transactional(readOnly = false)
    public BkType get(String id){
       return bookTypeDao.getone(id);
    }


    @Transactional(readOnly = false)
    public List<BkType> getAll() {

        return bookTypeDao.getAll();
    }


    @Transactional(readOnly = false)
    public void save(BkType bkType) {
        bookTypeDao.save(bkType);
    }


    @Transactional(readOnly = false)
    public void deleteone(BkType bkType) {

        super.delete(bkType);

    }

    @Transactional(readOnly = false)
    public void update(BkType bkType) {

        bookTypeDao.updateone(bkType);
    }


    public List<BkType> getbyPid(String pid) {

        return bookTypeDao.getbyPid(pid);


    }

    public BkType getByTypeName(String classcode){
        return bookTypeDao.getByTypeName(classcode);
    }
}